package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.JobInfoDao;
import com.internship.model.EnterpriseInfo;
import com.internship.model.JobInfo;
import com.internship.model.Jobenterprise;
import com.internship.page.Page;

@Service
public class JobInfoService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private JobInfoDao jobinfoDao;

	public Page<JobInfo> getJobinfoList(String XYDM,String JobName,int pageNumber) {
		Page<JobInfo> page = new Page<JobInfo>(pageNumber, PAGE_SIZE);
		List<JobInfo> list = jobinfoDao.getJobinfoList(XYDM, JobName, page);
		page.setResultList(list);
		return page;
	}
	public List<JobInfo> getJobinfoList() {
		List<JobInfo> list = jobinfoDao.getJobinfoList();
		return list;
	}
	public JobInfo getJobinfo(int id) {
		return  jobinfoDao.getJobinfo(id);
		
	}
	public int addJobinfo(JobInfo jobinfo) {
		return jobinfoDao.addJobinfo(jobinfo);
	}
	public int updateJobinfo(JobInfo jobinfo) {
		return jobinfoDao.updateJobinfo(jobinfo);
	}
	public int delJobinfo(int Id) {
		return jobinfoDao.delJobinfo(Id);
	}
	public int delAll(String[] ids) {
		return jobinfoDao.delAll(ids);
	}
	public List<EnterpriseInfo> getEnterpriseEnterList(int Id) {
		List<EnterpriseInfo> list = jobinfoDao.getEnterpriseEnterList(Id);
		return list;
	}
	public int addJobenterprise(Jobenterprise jobenterprise) {
		return jobinfoDao.addJobenterprise(jobenterprise);
	}
	public int delJobenterprise(int EnterpriseId,int JobId) {
		return jobinfoDao.delJobenterprise(EnterpriseId, JobId);
	}
	public List<JobInfo> getDistributionJobinfoList(String XYDM) {
		List<JobInfo> list = jobinfoDao.getDistributionJobinfoList(XYDM);
		return list;
	}
}
